-
Notifications
You must be signed in to change notification settings - Fork 88
refactor: move into npm workspace #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for netlify-plugin-nextjs-demo canceled.
|
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
a1bc47a
to
eee8c37
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question so far 😄
@@ -0,0 +1 @@ | |||
17.9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this perhaps be set to v16 so that this is on an LTS version of node? Or is there something about v17 that we want for these changes?
Depending on when it's looking like these changes will be merged and released we might be able to even go up to the newest LTS version (v18) which will be released on the April 19th.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I did this because I thought it needed to be 17 for workspaces to work properly, but I think 16 should be ok. Good point re 18 though. We should probably migrate later.
I still need to work out the best way to run the node 12 tests though, because right now they're failing as they don't support workspaces at all.
4e88f7a
to
2a7d5d1
Compare
43bdd60
to
1863b7e
Compare
@@ -23,13 +23,20 @@ jobs: | |||
|
|||
steps: | |||
- uses: actions/checkout@v2 | |||
- name: Use Node.js ${{ matrix.node-version }} | |||
- name: Installing with latest Node.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so we can use workspaces, which require node 16, but still run tests in node 12
"test": "run-s build build:demo test:jest", | ||
"build": "npm run -w @netlify/plugin-nextjs build", | ||
"postinstall": "run-s build install-husky", | ||
"install-husky": "if-env CI=1 || husky install node_modules/@netlify/eslint-config-node/.husky", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was causing issues installing this in CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM 🚀 Appreciate the workaround to support workspaces with a modern version of node while still running tests in npm v12. Fortunately we won't have to support v12 for too much longer since it will have reached end of life at the end of the month 🥳
Yeah, hopefully that means Next will drop support soon! Right now we're matching the minimum version supported by the latest version of each framework, so Gatsby uses 14 |
@@ -16,25 +16,27 @@ jobs: | |||
id: release | |||
with: | |||
token: ${{ steps.get-token.outputs.token }} | |||
release-type: node | |||
package-name: '@netlify/plugin-nextjs' | |||
command: manifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're changing to manifest releases because the package is in a subdirectory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Let's 🚢
Summary
This PR moves the plugin and one demo site into an npm workspace, to make it easier to manage packages, and to better handle dependency caching.
Before it can be merged the release please scripts and config need changing to reflect the fact that the plugin isn't in the root.
Test plan
This will involve ensuring all the demo sites build properly
Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was published correctly.